package bawei.com.bilibili;

import android.graphics.Color;

import android.os.Bundle;


import android.support.annotation.Nullable;
import android.support.v4.app.FragmentActivity;


import android.support.v7.widget.Toolbar;


import com.flyco.tablayout.SlidingTabLayout;



import bawei.com.adapter.AllareasRankPagerAdapter;

import bawei.com.widget.NoScrollViewPager;



import static bawei.com.bilibili.R.id.toolbar;

/**
 * 类描述:
 * 作者：cwm
 * 时间:2017/3/20 08:47
 * 邮箱:18310832074@163.com
 */

public class AllareasRankActivity extends FragmentActivity {

    private String[] titles = new String[] {
            "番剧", "动画", "音乐", "舞蹈", "游戏",
            "科技", "生活", "鬼畜", "时尚", "娱乐", "电影", "电视剧"
    };

    private String[] types = new String[] {
            "all-03-13.json", "all-03-1.json", "all-03-3.json",
            "all-03-129.json", "all-03-4.json", "all-03-36.json",
            "all-03-160.json", "all-03-155.json", "all-03-5.json",
            "all-03-119.json", "all-03-23.json", "all-03-11.json"
    };
    private SlidingTabLayout mSlidingTabLayout;

    private NoScrollViewPager mViewPager;

    private Toolbar mToolbar;


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_all_areas_rank);
        mSlidingTabLayout = (SlidingTabLayout) findViewById(R.id.sliding_tabs);
        mViewPager = (NoScrollViewPager) findViewById(R.id.view_pager);
        mToolbar = (Toolbar) findViewById(R.id.toolbar);
        mToolbar.setLogo(R.drawable.action_button_back_pressed_light);
        mToolbar.setTitle("全区排行榜");
        mToolbar.setTitleTextColor(Color.WHITE);
        mToolbar.inflateMenu(R.menu.menu_rank);
        AllareasRankPagerAdapter adapter=new AllareasRankPagerAdapter(getSupportFragmentManager(),titles,types);
        mViewPager.setAdapter(adapter);
        mSlidingTabLayout.setViewPager(mViewPager);
        mSlidingTabLayout.setTextSelectColor(Color.WHITE);
        mSlidingTabLayout.setTextUnselectColor(Color.GRAY);
        mSlidingTabLayout.setUnderlineColor(Color.WHITE);

    }

}
